<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>克隆节点</title>
    <style>
        #box img {
            height: 300px;
            width: 300px;
            margin: 10px;
        }
        #clonebtn {
            width: 100%;
        }
    </style>
</head>
<body>
    <div id="box">
        <img src="./images/monkey.jpg">
    </div>
    <button id="clonebtn">身外身</button>
</body>
<script>
    let clonebtnEle = document.getElementById("clonebtn");
    let boxEle = document.getElementById("box");
    let imgEle = document.querySelector("img");
    clonebtnEle.addEventListener("click", () => {
        let newImg = imgEle.cloneNode(true);
        boxEle.appendChild(newImg);
        // boxEle.innerHTML = newImg;
    });
</script>

</html>